/*******************************************************************************
						MASTERFILE for the replication of 

Steinmayr & Rossi (2023): Vaccine-skeptic physicians and patient vaccination 
	decisions. Health Economics.

Running this masterfile will execute all steps for data preparation and analysis.

Users need to change the project directory below.

The data for COVID-19 hospitalizations, cases and deaths are not shared on a daily
basis but only aggregated over time for data privacy reasons.

*******************************************************************************/

* Install necessary Stata packages
cap net install scheme-modern, from("https://raw.githubusercontent.com/mdroste/stata-scheme-modern/master/")
cap ado uninstall estimate_supt_critical_value
cap net install estimate_supt_critical_value, from("https://raw.githubusercontent.com/ryanedmundkessler/simultaneous_confidence_bands/master/ado/")
cap net install cleanplots, from("https://tdmize.github.io/data/cleanplots")
    set scheme cleanplots, perm      
set scheme modern, perm

* Set globals

// NOTE: replace XXX with your project directory 
global mainpath "XXX/replication"

* Subdirectories
global raw "$mainpath/Data/raw"
global edited "$mainpath/Data/edited"
global dopath "$mainpath/dofiles"
global output "$mainpath/output"

* Data import and edits

do "$dopath/import_pop_statistics.do"

do "$dopath/import_antivax_docs.do"

* data already aggregated due to protection of privacy 
*do "$dopath/import_cases_dead.do"

do "$dopath/import_nrw_2019.do"

do "$dopath/import_bpw_2022.do"

* data already aggregated due to protection of privacy 
*do "$dopath/prepare_hospital.do"

do "$dopath/import_vaccination_rates.do"

do "$dopath/import_waldorf.do"

do "$dopath/import_doctors.do"

do "$dopath/import_impfzentren.do"

do "$dopath/prepare_geodata.do"

do "$dopath/merge_datasets.do"

* Analysis

do "$dopath/desc_stats.do"

do "$dopath/analysis_graphs.do"

do "$dopath/analysis_tables.do"

do "$dopath/create_maps.do"
